package com.example.wuqujingdianphone.adapter;

import android.content.Context;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.wuqujingdianphone.R;
import com.example.wuqujingdianphone.bean.HomeFenBean;

import java.util.List;


public class HomeFenleiAdapter extends BaseQuickAdapter<HomeFenBean.ObjBean.FenleiListBean, BaseViewHolder> {
    private Context context;

    public HomeFenleiAdapter(Context context, int layoutResId, List data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeFenBean.ObjBean.FenleiListBean item) {
        helper.setText(R.id.fenlei_tv, item.getName());
        int pos = helper.getAdapterPosition();
        switch (pos) {
            case 0:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.yuexiang);
                break;
            case 1:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.tingshu);
                break;
            case 2:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.qikan);
                break;
            case 3:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.rixi);
                break;
            case 4:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.tiyan);
                break;
            case 5:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.shuyouhui);
                break;
            case 6:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.shujia_iv);
                break;
            case 7:
                helper.setImageResource(R.id.fenlei_iv, R.mipmap.qscan_iv);
                break;
        }
        //GlideUtil.loadImgSimple(context, item.getThumb(), (CircleImageView) helper.getView(R.id.fenlei_iv));
    }

}
